extern "C" {
    fn printf(_: *const i8, _: ...) -> i32;
    fn putchar(__c: i32) -> i32;
}
pub type Category = u32;
pub const IPv6Char: Category = 256;
pub const Userinfo: Category = 128;
pub const Fragment: Category = 64;
pub const Query: Category = 64;
pub const HexDigit: Category = 32;
pub const PCharSlash: Category = 16;
pub const SubDelim: Category = 8;
pub const GenDelim: Category = 4;
pub const Unreserved: Category = 2;
pub const Scheme: Category = 1;
#[no_mangle]
pub static mut char_cat: [u32; 256] = [0; 256];
#[no_mangle]
pub static mut alnum: *const i8 =
    b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\0" as *const u8 as *const i8;
#[no_mangle]
pub static mut unreserved: *const i8 = b"-._~\0" as *const u8 as *const i8;
#[no_mangle]
pub static mut subdelim: *const i8 = b"!$&'()*+,;=\0" as *const u8 as *const i8;
#[no_mangle]
pub extern "C" fn fill(mut value: u32, mut alnum_0: *const i8, mut special: *const i8) {
    while (unsafe { *alnum_0 }) != 0 {
        (unsafe { char_cat[*alnum_0 as u8 as usize] |= value });
        alnum_0 = unsafe { alnum_0.offset(1) };
    }
    while (unsafe { *special }) != 0 {
        (unsafe { char_cat[*special as u8 as usize] |= value });
        special = unsafe { special.offset(1) };
    }
}
#[no_mangle]
pub extern "C" fn print_table() {
    (unsafe {
        printf (b"// This file is generated by gen_char_category_table. DO NOT EDIT IT BY HAND!\n\nstatic const unsigned short char_cat[256] = {\n//   .0     .1     .2     .3     .4     .5     .6     .7     .8     .9     .A     .B     .C     .D     .E     .F\n\0" as * const u8 as * const i8 ,)
    });
    let mut y: u32 = 0 as u32;
    while y < 16 as u32 {
        (unsafe { putchar(' ' as i32) });
        let mut x: u32 = 0 as u32;
        while x < 16 as u32 {
            let offset: u32 = y.wrapping_mul(16 as i32 as u32).wrapping_add(x);
            (unsafe {
                printf(
                    b" 0x%03x%c\0" as *const u8 as *const i8,
                    char_cat[offset as usize],
                    if offset == 255 as u32 {
                        ' ' as i32
                    } else {
                        ',' as i32
                    },
                )
            });
            x = x.wrapping_add(1);
        }
        (unsafe { printf(b" // %01X0 ... %01XF\n\0" as *const u8 as *const i8, y, y) });
        y = y.wrapping_add(1);
    }
    (unsafe { printf(b"};\n\n\0" as *const u8 as *const i8) });
}
fn main_0() -> i32 {
    fill(
        Scheme as i32 as u32,
        unsafe { alnum },
        b"+-.\0" as *const u8 as *const i8,
    );
    fill(Unreserved as i32 as u32, unsafe { alnum }, unsafe {
        unreserved
    });
    fill(
        GenDelim as i32 as u32,
        unsafe { alnum },
        b":/?#[]@\0" as *const u8 as *const i8,
    );
    fill(SubDelim as i32 as u32, unsafe { alnum }, unsafe {
        subdelim
    });
    fill(
        PCharSlash as i32 as u32,
        unsafe { alnum },
        b":@/%\0" as *const u8 as *const i8,
    );
    fill(PCharSlash as i32 as u32, unsafe { unreserved }, unsafe {
        subdelim
    });
    fill(
        HexDigit as i32 as u32,
        b"0123456789\0" as *const u8 as *const i8,
        b"abcdefABCDEF\0" as *const u8 as *const i8,
    );
    fill(
        Query as i32 as u32,
        unsafe { alnum },
        b"/?:@%\0" as *const u8 as *const i8,
    );
    fill(Query as i32 as u32, unsafe { unreserved }, unsafe {
        subdelim
    });
    fill(
        Userinfo as i32 as u32,
        unsafe { alnum },
        b":%\0" as *const u8 as *const i8,
    );
    fill(Userinfo as i32 as u32, unsafe { unreserved }, unsafe {
        subdelim
    });
    fill(
        IPv6Char as i32 as u32,
        b"0123456789\0" as *const u8 as *const i8,
        b"abcdefABCDEF:\0" as *const u8 as *const i8,
    );
    print_table();
    return 0;
}
pub fn main() {
    ::std::process::exit(main_0() as i32)
}
